#Copyright 2009-2010 by Ward, David J ( pymethius@ominian.net )
class Registry(object):
    
    def __init__(self):
        self.users = {}
    
    def hasByName(self, username):
        """Return's true if a user with the specified exists"""
        return username in self.users.keys()
            
    def get(self, username): return self.users[username]
    
    def register(self, username, userObj):        
        if not self.users.has_key(username):
            self.users[username] = userObj
        
    
    def deregister(self, username):
        try:
            del self.users[username]
        except:
            pass